<?php
/*首页数据接口*/
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index() {
        $this->display();
    }
    public function getDataJson() {
        $data['com.jindouche.tiyan']['1.1.0']=true;
        $data['com.jindouche.admin']['1.0.0']=true;
        $data['com.jindouche.admin']['1.1.0']=true;
        $data['com.youyouche.app']['1.0.0']=true;
        $data['com.youyouche.admin']['1.2.0']=true;
        $this -> ajaxReturn($data,'JSONP');
    }
    public function getIndexData() {
        //实例化IndexModel;
        $indexModel = D("Index");
        $city=I('request.city');
        //车辆数据
        $carData = $indexModel->getCarData($city);
        $this -> ajaxReturn($carData,'JSONP');
    }
    /*
        功能:获取新车数据
    */
    public function getNewCarData() {
        // //拼接查询条件
        // $where = 'jdc_cars.is_show=1 and jdc_price.purchase_scheme=1 and jdc_price.is_new=1';
        $where = '1 = 1';

        //指导价范围
        if(I('request.car_price')){
           switch (I('request.car_price')) {          
                /*case '0':
                    //全部
                    $order = "first_pay asc";
                    break;*/
                case '1':
                    //2~3万
                    $where.=' and cszdj >= 50000 and cszdj< 100000';
                    break;
                case '2':
                    //3~4万
                    $where.=' and cszdj >= 100000 and cszdj < 150000';
                    break;
                case '3':
                    //4~5万
                    $where.=' and cszdj >= 150000 and cszdj < 200000';
                    break;
                case '4':
                    //5万以上
                    $where.=' and cszdj >= 200000  and cszdj < 250000';
                    break; 
                case '5':
                    //5万以上
                    $where.=' and cszdj >= 250000 and cszdj < 300000';
                    break;                                              
                default:
                    # code...
                    break;
            } 
        }
        //车型
        $cartype=null;
        if (I('request.cartype')) {
            $cartype = I('request.cartype');
            $carTypeDb = M('s_sjzd', null);
            $type = $carTypeDb -> where(['content' => $cartype]) -> find();
            $where.=" and jb = ".$type['id'];
        }
       /* //首次进入
        if(empty(I('request'))) {
            $order ="add_time desc";
        }*/
        //默认排序
        if(I('request.sort')){
          switch (I('request.sort')) {
            /*case '0':
                //默认排序
                $order ="add_time desc";
                break;*/
            case '1':
                //月供最低排序
                $order ="yg asc"; 
                break;
            case '2':
                //月供最高排序
                $order ="yg desc";
                break;
             default:
                # code...
                break;
            }  
        }   
        //首付范围
        if(I('request.month_pay')){
           switch (I('request.month_pay')) {          
                /*case '0':
                    //全部
                    $order = "first_pay asc";
                    break;*/
                case '1':
                    //2~3万
                    $where.=' and sf >= 2000 and sf < 3000';
                    break;
                case '2':
                    //3~4万
                    $where.=' and sf >= 3000 and sf < 4000';
                    break;
                case '3':
                    //4~5万
                    $where.=' and sf >= 4000 and sf < 5000';
                    break;
                case '4':
                    //5万以上
                    $where.=' and sf >= 5000  and sf < 10000';
                    break; 
                case '5':
                    //5万以上
                    $where.=' and sf >= 10000 ';
                    break;                                              
                default:
                    # code...
                    break;
            } 
        }

        //获取城市名称
        // $city=null;
        // if (I('request.city')) {
        //     $city = I('request.city');
        //     $cityObj = M('city');
        //     $where_map = "name like'%{$city}%' and is_show=1";
        //     $cityInfo = $cityObj->where($where_map)->field('id')->find(); 
        //     $where.=' and jdc_price.city_id = '.$cityInfo['id'];
        // }
        //获取品牌名称
        $brand=null;
         if (I('request.brandid')) {
            $brandid = I('request.brandid');
            $where.=" and ppid = ".$brandid;
        }

        //获取品牌名称
        $name=null;
         if (I('request.name')) {
            $name = I('request.name');
            $where.=" and qcmc like '%$name%'";
        }
        //获取要查询的页数
        $page=1;
        if(I('request.page')) {
            $page=I('request.page');
        }
        // //实例化IndexModel;
        $indexModel = D("Index");
        // //按查询条件获取新车数据
        $newCarData = $indexModel->getNewData($where, $order, $page);
        //$newCarData = I('request.city');
        $this->ajaxReturn($newCarData,'JSONP');
    }
    public function getDetailDate(){
        //获取城市
        $city=M('city');
        $where="name='".I('request.city')."' and is_show=1";
        $field="id";
        $city_info=$city->field($field)->where($where)->find();
        $fileName="CarJson/".I('request.carnum').'-'.$city_info['id'].'.json';
        $result=ossGetObject($fileName);
        if($result){
           $data=json_decode($result); 
        }else{
            
            //车辆数据
            $detail = D("Index");
            $datailData = [];
            // $detailData = $detail->getDetailsDate(I('request.carnum'));
            $carsData = $detail->getCarsDate(I('request.carnum'));
            $carPrice = [];
            // $carPrice = $detail->getCarPrice(I('request.carnum'),$city_info['id']);
            $carRecommend = $detail->getCarsRecommend($carsData,$city_info['id']);
            $data=array('carData'=>array_merge($detailData,$carsData),'carPrice'=>$carPrice,'carRecommend'=>$carRecommend);
            ossPutObject($fileName,json_encode($data));
        }
        $detail = D("Index");
        $carsData = $detail->getCarsDate(I('request.carnum'));
        $carRecommend = $detail->getCarsRecommend($carsData,$city_info['id']);
        $data=array('carData'=> $carsData, 'carRecommend'=>$carRecommend);
        $this->ajaxReturn($data,'JSONP');
    }
    public function getUserOrder(){
        $indexModel = D("Index");
        $data = $indexModel->getUserOrder(I('request.mobilephone'));
        $this->ajaxReturn($data,'JSONP');
    }
    public function getCarList(){
        $indexModel = D("Index");
        $data = $indexModel->getCarList();
        $this->ajaxReturn($data,'JSONP');
    }
    public function setUserOrder(){
        
        $indexModel = D("Index");
        $order_db = M('order');
        $result = getDocumentStatus(I('request.orderid'));
        if (in_array("error", $result) && $result['status'] == 'error') {
            $this->ajaxReturn(['code' => 0],'JSONP');
        } elseif (in_array('signing', $result) && $result['documentStatus'] == 'signing') {
            $order_res = $order_db -> where('orderid='.I('request.orderid')) -> find();
            $this->ajaxReturn(['code' => 1, 'url' => $order_res['lingQianUrl']],'JSONP');
        } elseif (in_array('signed', $result) && $result['documentStatus'] == 'signed') {
            $indexModel->setUserOrder(I('request.orderid'));
            $this->ajaxReturn(['code' => 2],'JSONP');
        }
    }

    public function getOrderPay(){
        
        $indexModel = D("Index");
        $data = $indexModel->getOrderPay(I('request.mobilephone'));
        $this->ajaxReturn($data,'JSONP');
    }

    public function checkEvaluate(){
        
        $evaluate = M("evaluate");
        $data = $evaluate->where(array('orderid'=>I('request.orderid'),'type'=>I('request.type')))->find();
        if($data){
            $result=1;
        }else{
            $result=0;
        }
        $this->ajaxReturn($result,'JSONP');
    }
    
    public function uploadEvaluate(){
        $evaluate = M("evaluate");
        $data["orderid"]=I('request.orderid');
        $data["type"]=I('request.type');
        $data["score"]=I('request.score');
        $data["desc"]=I('request.desc');
        $data["create_time"]=time();
        $result = $evaluate->add($data);
        $this->ajaxReturn($result,'JSONP');
    }
    public function addCollect(){
        $user = M("user");
        $where["tel"]=I('request.mobilephone');

        $result = $user->where($where)->find();
        if($result['collect']){
            $data['collect']=$result['collect'].','.I('request.carnum');
        }else{
            $data['collect']=I('request.carnum');
        }
        $user->where($where)->save($data);
        $this->ajaxReturn($data['collect'],'JSONP');
    }
    public function delCollect(){
        $user = M("user");
        $where["tel"]=I('request.mobilephone');

        $result = $user->where($where)->find();
        $collect_arr=explode(',',$result['collect']);
        $key=array_search(I('request.carnum'),$collect_arr);
        if($collect_arr[$key]){
            unset($collect_arr[$key]);
        }
        if(count($collect_arr)>0){
             $data['collect']=implode(',',$collect_arr);
        }else{
            $data['collect']="";
        }
        $user->where($where)->save($data);
        $this->ajaxReturn($data['collect'],'JSONP');
    }
    public function getCollect(){
        $user = M("user");
        $where["tel"]=I('request.mobilephone');

        $result = $user->where($where)->find($data);
        $collect_arr=explode(',',$result['collect']);
        $car = M('cars');
        $field = "*";
        $where_car['carnum']=array("in",$collect_arr);
        $where_car['is_show']=1;
        $new_car = $car->field($field)->where($where_car)->select();


        //获取城市
        $city=M('city');
        $where="name='".I('request.city')."' and is_show=1";
        $field="id";
        $city_info=$city->field($field)->where($where)->find();
        //获取价格
        $price=M('price');
        $field="carnum,month_pay";
        $where_price['carnum']=array("in",$collect_arr);
        $where_price['city_id']=$city_info['id'];
        $price_infos=$price->field($field)->where($where_price)->select();
        foreach($price_infos as $val){
            $price_data[$val['carnum']]=$val['month_pay'];
        }

        foreach($new_car as $key=>$val){
            $new_car[$key]['month_pay']=$price_data[$val['carnum']];
        }
        $this->ajaxReturn($new_car,'JSONP');
    }

    public function addDevice()
    {
        $device_db = M('device');
        $device_res = $device_db -> where('uuid='.I('request.uuid')) -> find();
        if (!$device_res) {
            $data = [
                'uuid' => I('request.uuid')
            ];
            $id = $device_db -> add($data);
            $this -> ajaxReturn(['uuid' => I('request.uuid'), 'error' => 1], 'JSONP');
        }
    }

    public function getBaike()
    {
        $car_baike = M('car_baike');
        $baike_res = $car_baike->field('id,title') -> where('is_show=1') -> select();
        $this -> ajaxReturn($baike_res, 'JSONP');
    }

    public function getBaikeDetail()
    {
        $car_baike = M('car_baike');
        $baike_res = $car_baike->field('id,title,content') -> where('id='.I('request.id')) -> find();
        $this -> ajaxReturn($baike_res, 'JSONP');
    }

    public function getBrands()
    {
        $brandDb = M('s_sjzd', null);
        $brands = $brandDb -> where(['type' => '品牌', 'isdel' => 0]) -> select();
        // foreach ($brands as $k => $v) {

        // }
        $this -> ajaxReturn($brands, 'JSONP');
    }

    public function getImages()
    {
        $imageDb = M('sjlbtp_manage', null);
        $list = $imageDb -> where() -> field('id, title, tp_Dz as tpdz, Url') -> select();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getAdvertising()
    {
        $tpwz = I('request.tpwz');
        $Db = M('gggl_manage', null);
        $where = "tpwz in (".$tpwz.")";
        $list = $Db -> where($where) -> field('id, title, tp_Dz as tpdz, Url, tpwz') -> select();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getCarData()
    {
        $isxctj = I('request.isxctj');
        $iscxcx = I('request.iscxcx');

        $carDb = M('qcgl_manage', null);
        $list = $carDb -> where('isxctj = '.$isxctj.' or iscxcx = '.$iscxcx) -> field('id, qcmc, ppid, yg, sf, isxctj, iscxcx') -> select();

        $brandDb = M('s_sjzd', null);
        $ppid = "id in (".implode(',', array_column($list, 'ppid')).")";
        $brands = $brandDb -> where($ppid) -> field('id, content') -> select();
        $brand = [];
        foreach ($brands as $k => $v) {
            if (!key_exists($v['id'], $brnad)) {
                $brand[$v['id']] = $v;
            }
        }

        $imageDb = M('qcgl_tp', null);
        $qcids = "qcid in (".implode(',', array_column($list, 'id')).") and type = 162";
        $images = $imageDb -> where($qcids) -> field('qcid, tpmc') -> order('pxh asc') -> select();
        $image = [];
        foreach ($images as $k => $v) {
            if (!key_exists($v['qcid'], $image)) {
                $image[$v['qcid']] = $v;
            }
        }

        foreach ($list as $k => $v) {
            $list[$k]['brand'] = $brand[$v['ppid']]['content'];
            $list[$k]['image'] = $image[$v['id']]['tpmc'];
        }

        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getCarConfgue()
    {
        $brandDb = M('s_sjzd', null);
        $brands = $brandDb -> where("type = '品牌' or type = '车辆级别' and isdel = 0") -> field('id, type, content, isdel') -> select();
        $this -> ajaxReturn($brands, 'JSONP');
    }

    public function getCarListData()
    {
        $page = I('request.page');
        $ppid = I('request.ppid');
        $name = I('request.name');
        $jb = I('request.jb');
        $sf = I('request.sf');
        $yg = I('request.yg');
        $cj = I('request.cj');
        $sort = I('request.sort');
        $rsort = I('request.rsort');
        $isxctj = I('request.isxctj');
        $iscxcx = I('request.iscxcx');
        $carDb = M('qcgl_manage', null);
        $first = ($page - 1) * 10;
        $where = 'isdel = 0';
        if ($ppid) {
            $where .= ' and ppid = '.$ppid;
        }
        if ($name) {
            $where .= " and qcmc like "."'%".$name."%'";
        }
        if ($jb) {
            $where .= " and jb = ".$jb;
        }
        if ($sf) {
            if ($sf == 1) {
                $where .= " and sf <= 10000";
            } else if ($sf == 2) {
                $where .= " and sf >= 10000 and sf <= 20000";
            } else if ($sf == 3) {
                $where .= " and sf >= 20000 and sf <= 30000";
            } else if ($sf == 4) {
                $where .= " and sf >= 30000 and sf <= 40000";
            } else if ($sf == 5) {
                $where .= " and sf >= 40000 and sf <= 50000";
            } else if ($sf == 5) {
                $where .= " and sf >= 50000";
            }
        }
        if ($yg) {
            if ($yg == 1) {
                $where .= " and yg <= 2000";
            } else if ($yg == 2) {
                $where .= " and yg >= 2000 and yg <= 3000";
            } else if ($yg == 3) {
                $where .= " and yg >= 3000 and yg <= 4000";
            } else if ($yg == 4) {
                $where .= " and yg >= 4000 and yg <= 5000";
            } else if ($yg == 5) {
                $where .= " and yg >= 5000";
            }
        }
        if ($cj) {
            if ($cj == 1) {
                $where .= " and cszdj <= 100000";
            } else if ($cj == 2) {
                $where .= " and cszdj >= 100000 and cszdj <= 200000";
            } else if ($cj == 3) {
                $where .= " and cszdj >= 200000 and cszdj <= 300000";
            }
        }
        if ($isxctj) {
            $where .= ' and isxctj = '.$isxctj;
        }
        if ($iscxcx) {
            $where .= ' and iscxcx = '.$iscxcx;
        }

        $order = 'ishdcx desc, iscxcx desc, isxctj desc, id desc';
        if ($sort == 1 && $rsort == 1) {
            $order = 'sf asc';
        } else if ($sort == 2 && $rsort == 1) {
            $order = 'sf desc';
        } else if ($sort == 1 && $rsort == 2) {
            $order = 'yg asc';
        } else if ($sort == 2 && $rsort == 2) {
            $order = 'yg desc';
        } else if ($iscxcx == 1) {
            $order = 'iscxcx desc';
        } else if ($isxctj == 1) {
            $order = 'isxctj desc';
        }
        $list = $carDb -> where($where) -> field('id, qcmc, yg, sf, xsjg') -> limit($first, 10) -> order($order) -> select();
        $where = "qcid in (".implode(',', array_column($list, 'id')).") and type = 162";
        $imageDb = M('qcgl_tp', null);
        $qcids = " qcid in (".implode(',', array_column($list, 'id')).")";
        $images = $imageDb -> where($qcids) -> field('id, qcid, type, tpmc') -> order('pxh asc') -> select();
        $image = [];
        foreach ($images as $k => $v) {
            if (!key_exists($v['qcid'], $image)) {
                $image[$v['qcid']] = $v['tpmc'];
            }
        }
        foreach ($list as $k => $v) {
            $list[$k]['image'] = $image[$v['id']];
        }
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getCarDetails()
    {
        $id = I('request.id');
        $hyid = I('request.hyid');
        $detail = D("Index");
        $carsData = $detail->getCarsDate($id, $hyid);
        // $carRecommend = $detail->getCarsRecommend($carsData,$city_info['id']);
        $data=array('carData'=> $carsData);
        $this->ajaxReturn($data,'JSONP');
    }

    public function getCsjr()
    {
        $qcid = I('request.qcid');

    }

    public function getAboutUU()
    {
        $aboutDb = M('about_manage', null);
        $list = $aboutDb ->where(['id' => 1]) -> find();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getStoreData()
    {   
        $page = I('request.page');
        $province = I('request.province');
        $city = I('request.city');
        $area = I('request.area');

        $storeDb = M('mdgl_manage', null);
        $index = ($page - 1) * 10;
        $where = '1 = 1';
        if ($province) {
            $where .= " and address like "."'%".$province."%'";
        }
        if ($city) {
            $where .= " and address like "."'%".$city."%'";
        }
        if ($area) {
            $where .= " and address like "."'%".$area."%'";
        }
        $list = $storeDb -> where($where) -> field('id, mdmc, address, lxdh, lng, lat') -> limit($index, 10) -> select();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getAllStoreData()
    {
        $mdDb = M('mdgl_manage', null);
        $mdlist = $mdDb -> field('id, lng, lat, lxdh') -> select();
        $this -> ajaxReturn($mdlist, 'JSONP');
    }

    public function getRecruit()
    {
        $zpDb = M('zpxx_manage', null);
        $list = $zpDb -> field('id, title,fbsj') -> select();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getRecruitInfo()
    {
        $zpid = I('request.zpid');
        $zpDb = M('zpxx_manage', null);
        $list = $zpDb -> where(['id' => $zpid]) -> field('id, title, contents, gzdd, gzjy, xl, gzlx, zprs, zwyx, zwyx') -> find();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function getNewActivity()
    {
        $newsDb = M('news_manage', null);
        $list = $newsDb -> where(['id' => 1]) -> find();
        $this -> ajaxReturn($list, 'JSONP');
    }

    public function setCollection()
    {
        $qcid = I('request.qcid');
        $hyid = I('request.hyid');

        $qcDb = M('qcgl_manage', null);
        $qclist = $qcDb -> where(['id' => $qcid]) -> find();
        $imageDb = M('qcgl_tp', null);
        $images = $imageDb -> where(['qcid' => $qcid, 'type' => 162]) -> order('pxh asc') -> select();
        $image = [];
        foreach ($images as $k => $v) {
            if (!key_exists($v['qcid'], $image)) {
                $image[$v['qcid']] = $v['tpmc'];
                break;
            }
        }
        $data = [];
        $data['hyid'] = $hyid;
        $data['qcid'] = $qcid;
        $data['qctp'] = $image[$qcid];
        $data['qcmc'] = $qclist['qcmc'];
        $data['cszdj'] = $qclist['cszdj'];
        $data['sf'] = $qclist['sf'];
        $data['yg'] = $qcid['yg'];
        $data['scsj'] = date('Y/m/d H:i:s', time());
        $collectionDb = M('wdsc_manage', null);
        $id = $collectionDb -> add($data);
        if ($id) {
            $this -> ajaxReturn(['status' => 'success'], 'JSONP');
        } else {
            $this -> ajaxReturn(['status' => 'error'], 'JSONP');
        }
    }

    public function cancelCollection()
    {
        $qcid = I('request.qcid');
        $hyid = I('request.hyid');
        
        $collectionDb = M('wdsc_manage', null);
        $result = $collectionDb -> where(['qcid' => $qcid, 'hyid' => $hyid]) -> delete();
        if ($result) {
            $this -> ajaxReturn(['status' => 'success'], 'JSONP');
        } else {
            $this -> ajaxReturn(['status' => 'error'], 'JSONP');
        }
    }

    public function getCollection()
    {
        $hyid = I('request.hyid');
        $collectionDb = M('wdsc_manage', null);
        $colletions = $collectionDb -> where(['hyid' => $hyid]) -> select();
        $this -> ajaxReturn($colletions, 'JSONP');
    }

    public function getVerify()
    {
        $Verify = new \Think\Verify();
        $Verify -> fontSize = 80;
        $Verify -> length   = 4;
        $Verify -> useNoise = false;
        $Verify->entry();
    }

    public function reserveStore()
    {
        $tel = I('request.tel');
        $code = I('request.code');
        $mdtel = I('request.mdtel');
        $mdid = I('request.mdid');

        $Verify = new \Think\Verify();
        if (!$Verify -> check($code, '')) {
            $this -> ajaxReturn(['status' => 'error', 'msg' => '验证码错误'], 'JSONP');
        }
        $userDb = M('user');
        $user = $userDb -> where(['tel' => $tel]) -> find();
        if (!$user) {
            $data = [];
            $data['nickname'] = $tel;
            $data['tel'] = $tel;
            $id = $userDb -> add($data);
            if (!$id) {
                $this -> ajaxReturn(['status' => 'error', 'msg' => '预约到店失败'], 'JSONP');
            }
        }

        $mdDb = M('mdgl_manage', null);
        $mdlist = $mdDb -> where(['id' => $mdid, 'lxdh' => $mdtel]) -> find();
        if (!$mdlist) {
            $this -> ajaxReturn(['status' => 'error', 'msg' => '预约到店失败'], 'JSONP');
        }

        $suserDb = M('s_userinfo', null);
        $suser = $suserDb -> where(['id' => $mdlist['userid']]) -> find();
        if (!$suser) {
            $this -> ajaxReturn(['status' => 'error', 'msg' => '预约到店失败'], 'JSONP');
        }
        $user = $userDb -> where(['tel' => $tel]) -> find();
        aliyunSendMsg($suser['lxdh'], $user['nickname'], $tel);
        $jsxDb = M('jsx_manage', null);
        $jsx = $jsxDb -> where(['province' => $mdlist['province'], 'city' => $mdlist['city'], 'distric' => $mdlist['distric']]) -> find();
        if (!$jsx) {
            $jsxuser = $suserDb -> where(['id' => $jsx['userid']]) -> find();
            if ($jsxuser) {
                aliyunSendMsg($jsxuser['lxdh'], $user['nickname'], $tel);
            }
        }
        $this -> ajaxReturn(['status' => 'success', 'msg' => '预约到店成功'], 'JSONP');
    }

    public function addPositon()
    {
        $name = I('request.name');
        $sex = I('request.sex');
        $email = I('request.email');
        $tel = I('request.tel');
        $education = I('request.education');
        $institution = I('request.institution');
        $resume = I('request.resume');
        $zpid = I('request.zpid');
        $hyid = I('request.hyid');
        $code = I('request.verify');

        $Verify = new \Think\Verify();
        if (!$Verify -> check($code, '')) {
            $this -> ajaxReturn(['status' => 'error', 'msg' => '验证码错误'], 'JSONP');
        }
        $data = [];
        $data['xm'] = $name;
        $data['sex'] = $sex;
        $data['email'] = $email;
        $data['lxdh'] = $tel;
        $data['zgxl'] = $education;
        $data['byyx'] = $institution;
        $data['jl'] = $resume;
        $data['hyid'] = $hyid;
        $data['zpxxid'] = $zpid;

        $zpDb = M('zpxx_info', null);
        $id = $zpDb -> add($data);
        if ($id) {
            $this -> ajaxReturn(['status' => 'success', 'msg' => '申请成功'], 'JSONP');
        } else{
            $this -> ajaxReturn(['status' => 'error', 'msg' => '申请失败'], 'JSONP');
        }

    }

    public function applyRefund()
    {
        $orderid = I('request.orderid');
        $orderDb = M('order');
        $result = $orderDb -> where(['orderid' => $orderid]) -> save(['apply_refund' => 1]);
        if ($result) {
            $this -> ajaxReturn(['status' => 'success', 'msg' => '申请成功,等待审核'], 'JSONP');
        } else {
            $this -> ajaxReturn(['status' => 'error', 'msg' => '申请失败'], 'JSONP');
        }

    }
}
